<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box{
            background-color: aqua;
            width: 600px;
            height: 200px;
            background: url(../../作业/images/course01.png) no-repeat top center/cover;
            position: relative;
        }
        .btn{
            background-color:white;
            width: 20px;
            height: 20px;
            border: 0 solid white;
            position: absolute;
            right: 8px;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <div class="box">
        <button class="btn"></button>
    </div>
    <script>
        const divv=document.querySelector('div')
        divv.addEventListener('mouseenter',function(){
            console.log('经过')
        })
        divv.addEventListener('mouseleave',function(){
            console.log('离开')
        })
        const btn=document.querySelector('button')
        btn.addEventListener('click',function(){
            divv.style.display='none'
        })
    </script>
</body>
</html>